package svc

import (
	"album-api/internal/config"
	"github.com/zeromicro/go-zero/zrpc"
	alclient "grpc-common/album/albumclient"
	"grpc-common/search/scclient"
)

type ServiceContext struct {
	Config    config.Config
	AlbumRpc  alclient.Album
	SearchRpc scclient.Search
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:    c,
		AlbumRpc:  alclient.NewAlbum(zrpc.MustNewClient(c.AlbumRpc)),
		SearchRpc: scclient.NewSearch(zrpc.MustNewClient(c.SearchRpc)),
	}
}
